/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.emergency.resources.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.hopes.bizz.emergency.common.constant.PlanDicConstant;
import com.hopes.bizz.emergency.common.constant.enums.ParkEmergencyModDictEnum;
import com.hopes.bizz.emergency.common.constant.enums.ParkEmergencySysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 评估记录总结表
 *
 * @author cx
 * @date 2024-01-11 20:08:06
 */
@Data
@TableName("er_emergency_evaluate_record_summary")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "评估记录总结表")
public class ErEmergencyEvaluateRecordSummaryEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


	/**
	* 标识
	*/
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description="标识")
    private Long id;

	/**
	* 对象编码
	*/
    @Schema(description="对象编码")
    private String objCode;

	/**
	* 对象标识
	*/
    @Schema(description="对象标识")
    private Long objId;

	/**
	* 综合得分
	*/
    @Schema(description="综合得分")
    private Double compositeScore;

	/**
	* 评估时间
	*/
    @Schema(description="评估时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date evaluateTime;

	/**
	* 机构ID
	*/
    @Schema(description="机构ID")
    private Long orgId;

	public String getObjIdStr(){
		if (this.getObjCode().equals(PlanDicConstant.EVALUATE_TYPE_TEAM)){
			return DictResolver.getItemLabelByValue(ParkEmergencyModDictEnum.emergency_team_id_just, this.getObjId());
		}
		if (this.getObjCode().equals(PlanDicConstant.EVALUATE_TYPE_EXPERT)){
			return DictResolver.getItemLabelByValue(ParkEmergencyModDictEnum.emergency_expert_id_just, this.getObjId());
		}

		return null;
	}

}